<cfsilent>
<!---
Copyright: (c) 2006 The MachBlog Authors
Authors: Matt Woodward (mpwoodward@gmail.com) & Peter J. Farrell (pjf@maestropublishing.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

$Id: blogEntryForm.cfm 1149 2007-05-09 13:39:34Z mpwoodward $

Notes:
--->
<!--- get the entry bean and categories query from the event object --->
<cfset variables.entry = event.getArg("entry", createObject("component", "org.machblog.entry.Entry").init()) />
<cfset variables.categories = event.getArg("categories") />
<cfset variables.comments = entry.getComments() />
<cfset variables.trackbacks = entry.getTrackbacks() />

<!--- get message and result stuff --->
<cfif event.isArgDefined("message")>
	<cfset variables.message = event.getArg("message") />
</cfif>

<cfif event.isArgDefined("results")>
	<cfset variables.results = event.getArg("results") />
	<cfif IsStruct(variables.results) AND StructKeyExists(variables.results, "message")>
		<cfset variables.message = results.message />
	</cfif>
</cfif>

<!--- put category ids from entry bean in a list for easier use with the select box --->
<cfset variables.categoryIds = "" />

<cfif ArrayLen(entry.getCategories()) GT 0>
	<cfset variables.entryCats = entry.getCategories() />
	<cfloop index="i" from="1" to="#ArrayLen(entry.getCategories())#" step="1">
		<cfset variables.categoryIds = ListAppend(variables.categoryIds, variables.entryCats[i][1], ",") />
	</cfloop>
</cfif>
<cfif variables.entry.getEntryId() EQ "">
	<cfset event.setArg("meta.title", "#getProperty("resourceBundleService").getResourceBundle().getResource("createblogentry")#" & getProperty("titleSuffix")) />
<cfelse>
	<cfset event.setArg("meta.title", "#getProperty("resourceBundleService").getResourceBundle().getResource("updateblogentry")#" & getProperty("titleSuffix")) />
</cfif>
</cfsilent>
<cfinclude template="#getProperty('skinsPath')##getProperty('skin')#/admin/blogEntryForm.cfm" />